package com.hz.lowb.nami.common.api.controller;

import com.hz.lowb.nami.base.dto.User;
import com.hz.lowb.nami.base.service.api.IUserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p> Title：UserController </p>
 * <p> Description：用户控制器 </p>
 * <p> Group：LowB </p>
 * @Author TieCheng
 * @Date 2017/1/11 17:05
 * @Since 0.0.5
 */
@RestController
@RequestMapping("/nami")
public class UserController {

    @Resource
    private IUserService userService;

    @ApiOperation(value = "获取用户信息", notes = "根据ID获取用户信息")
    @ApiImplicitParam(name = "id", value = "用户ID", required = true,dataType = "Long",paramType = "path")
    @RequestMapping(value = "user/{id}", method = RequestMethod.GET,produces = "application/json")
    public User user(@PathVariable("id") Long id) {
        return userService.getById(id);
    }

}
